package com.ipcount.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 配置获取ip相关的属性配置类，最终此配置类要和配置文件中的属性对应
 *
 * @author xiaozhua
 * @date 2022/9/13 14:46
 */
@ConfigurationProperties(prefix="tools.ip")
public class IpProperties {
    /**
     * 日志的显示周期
     */
    private Long cycle = 5L;
    /**
     * 是否周期内重置数据，默认是不重置
     */
    private Boolean cycleReset = false;
    /**
     * 日志输出模式，detail:详细模式 ，simple:极简模式
     * 定义日志输出模式枚举类数据结构
     */
    private String model=LogModel.DETAIL.value;
    public enum LogModel {
        DETAIL("detail"),
        SIMPLE("simple");
        private String value;
        LogModel(String value){
            this.value=value;
        }
        public String getValue(){
            return value;
        }
    }

    public Long getCycle() {
        return cycle;
    }

    public void setCycle(Long cycle) {
        this.cycle = cycle;
    }

    public Boolean getCyccleReset() {
        return cycleReset;
    }

    public void setCyccleReset(Boolean cycleReset) {
        this.cycleReset = cycleReset;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }
}
